An image sensor can be used to capture color information about a scene. The image sensor can include pixel elements that are configured to respond differently to different wavelengths of light, much like a human visual system. In many cases, a pixel element of an image sensor can achieve such color selectivity using a color filter, which filters the incoming light reaching the pixel element based on the light's wavelength. For an image sensor with a plurality of pixel elements arranged in an array, the color filters for the plurality of pixel elements can be arranged in an array as well. Such color filters are often referred to as a color filter array (CFA).
There are many types of CFAs. One of the widely used CFAs is a Bayer CFA, which arranges the color filters in an alternating, checkerboard pattern. FIG. 1A illustrates a Bayer CFA. The Bayer CFA 102 can include a plurality of color filters (e.g., Gr 104, R 106, B 108, and Gb 110), each of which filters the incoming light reaching a pixel element based on the light's wavelength. For example, a pixel underlying a green filter 104 can capture light with a wavelength in the range of the color “green”; a pixel underlying a red filter 106 can capture light with a wavelength in the range of the color “red”; and a pixel underlying a blue filter 108 can capture light with a wavelength in the range of the color “blue.” The Bayer CFA 102 can be overlaid on the pixel elements so that the underlying pixel elements only observe the light that passes through the overlaid filter. The Bayer CFA 102 can arrange the color filters in a checkerboard pattern. In the Bayer CFA 102, there are twice as many green filters 104, 110 as there are red filters 106 or blue filters 108. There may be other types of CFAs. Different CFAs differ in (1) the filters used to pass selected wavelengths of light and/or (2) the arrangement of filters in the array.
An image captured by an image sensor with a CFA can be processed to generate a color image. In particular, each color channel (e.g., Red, Green, Blue) can be separated into separate “channels.” As an example, FIG. 1B illustrates the Green channel 120 of the captured image 102. The Green channel 120 includes pixels with missing values 118 because those pixels were used to capture other colors (e.g., Red or Blue). These missing values 118 can be interpolated from neighboring pixels 110, 112, 114, 116 to fill-in the missing value. This process can be repeated for other color channels. By stacking the interpolated color channels, a color image can be generated.
An image captured by an image sensor can be subject to undesired shading effects. The shading effects refer to a phenomenon in which a brightness of an image is reduced. In some cases, the shading effects can vary as a function of a spatial location in an image. One of the prominent spatially-varying shading effects is referred to as the color non-uniformity effect. The color non-uniformity effect refers to a phenomenon in which a color of a captured image varies spatially, even when the physical properties of the light (e.g., the amount of light and/or the wavelength of the captured light) captured by the image sensor is uniform across spatial locations in the image sensor. A typical symptom of a color non-uniformity effect can include a green tint at the center of an image, which fades into a magenta tint towards the edges of an image. This particular symptom has been referred to as the “green spot” issue. The color non-uniformity effect can be prominent when a camera captures an image of white or gray surfaces, such as a wall or a piece of paper.
Another one of the prominent spatially-varying shading effects is referred to as a vignetting effect. The vignetting effect refers to a phenomenon in which less light reaches the corners of an image sensor compared to the center of an image sensor. This results in decreasing brightness as one moves away from the center of an image and towards the edges of the image. FIG. 2 illustrates a typical vignetting effect. When a camera is used to capture an image 200 of a uniform white surface, the vignetting effect can render the corners of the image 202 darker than the center of the image 204.
Because the spatially-varying shading effects can be undesirable, there is a need for an effective, efficient mechanism for removing the spatially-varying shading effects from an image.